package cn.wolfcode.enums;

import lombok.Getter;

@Getter
public enum ConsumptionEnums {
    CONSUME("待结算", 0),
    UADIT("待审核", 1),
    FINISH("归档", 2),
    FAILURE("坏账", 3);

    private String name;
    private Integer value;

    ConsumptionEnums(String name, Integer value) {
        this.name = name;
        this.value = value;
    }

    public static String findName(Integer value) {
        //获取所有的示例
        ConsumptionEnums[] consumptionEnums = values();
        for (ConsumptionEnums anEnum : consumptionEnums) {
            //判断实例中的value是否等于传入的value
            if (anEnum.value.equals(value)) {
                return anEnum.name;
            }
        }
        return null;
    }

}
